package views
{
	import caurina.transitions.Equations;
	import caurina.transitions.Tweener;
	import flash.display.MovieClip;
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.events.TimerEvent;
	import flash.utils.Timer;
	import models.MainModel;
	import models.types.SectionType;
	import views.components.Section;
	import caurina.transitions.properties.ColorShortcuts;
	
	ColorShortcuts.init();

	public class MenuView extends Sprite
	{
		private var _sections:/*Section*/Array = [];
		private var menu_sprite:BranchsMC;
		private var _bracnhes:Array = [];
		
		public function MenuView():void
		{
			menu_sprite = new BranchsMC();
		}
		
		public function create():void
		{
			addChild(menu_sprite);
			
			buildSections();
		}
		
		private function buildSections():void
		{
			var delay:Number = 0;
			
			for (var i:int = 0 ; i < MainModel.instance.sections.length ; i++ )
			{
				var section:Section = new Section(menu_sprite.getChildByName("Branch" + (i + 1) + "MC"), MainModel.instance.sections[i]);
				
				_sections.push(section);
			}
			
			for (i = 0 ; i < Main.instance.fade_sequence.length ; i++ )
			{
				_sections[Main.instance.fade_sequence[i]].show(delay);
				
				delay += 0.2;
			}
		}
	}
	
}